import { defineStore } from "pinia";

//定义容器
const useMainStore = defineStore('main', {
    state: () => {
        return{
            //储存数据
            todoList:{}
        }
    },
    getters: {

    },
    actions: {
        //存储登录的账号密码，进行传值
        userchange(){
            //事件触发，将把数据保存在浏览器缓存，再存储到仓库
            let tododata = JSON.parse(localStorage.getItem("userfoin"))
            this.todoList =  tododata
        }
    }
})

//导出，响应式数据
export { useMainStore }